import React from 'react'

export default function App() {
  
  const [count, setCount] = useState(0)
  const [isHot,setIsHot] = useState(false)
  const [person,setPerson] = useState(['张麻子','李四','王五'])

  const setCountHandle = () => {
    setCount(count + 1);
    console.log(count,'333');
  }

  console.log('组件被重新渲染了');
  
  return (
    <div>
      <h1>累加的值是{count}</h1>
      <h2>天气真的{isHot ? '热啊' : '冷啊'}</h2>
      <button onClick={setCountHandle}>累加</button>
    </div>
  )
}
 